<template>
  <div id="detailed">
    <c-title :hide="false" :text="orderType === 'store' || orderType === 'storeBalance' ? '我的提成' : `我的${this.fun.initWithdrawal()}`"></c-title>

    <div class="today-box" v-if="orderType === 'store' || orderType === 'storeBalance'">
      <div class="month-sty">{{ratioDatas[3] ? ratioDatas[3].data : ""}}{{ratioDatas[3] ? "￥" + ratioDatas[3].money : ""}}</div>
      <ul class="today_bonus">
        <li v-for="(item, i) in ratioDatas" :key="i" :class="item.name" v-if="i < 3">
          <div class="box-money">{{ item.money }}</div>
          <div class="box-data">{{ item.data }}</div>
        </li>
      </ul>
    </div>

	<van-tabs v-model="selected" @click="swichTabTItem" title-active-color="var(--themeBaseColor)" background="#f5f5f5">
    <template v-if="orderType !== 'storeBalance'">
      <van-tab name="" title="全部" v-if="orderType !== 'store'"></van-tab>
      <van-tab name="3" title="全部" v-if="orderType === 'store'">全部 </van-tab>
      <van-tab name="0" :title="orderType !== 'store' ? '申请中' : '未结算' " ></van-tab>
      <van-tab name="1" :title="orderType !== 'store' ? '待打款' : '已结算'" ></van-tab>
      <van-tab name="2" title="已打款" v-if="orderType !== 'store'"></van-tab>
      <van-tab name="-1" :title="orderType == 'supplier' ? '驳回/无效' : '已失效'" ></van-tab>
      <van-tab  name="3" title="已驳回" v-if="orderType !== 'store'"></van-tab>
    </template>
    <template v-if="orderType === 'storeBalance'">
      <van-tab name="1" title="已结算"></van-tab>
      <van-tab name="2" title="已分账"></van-tab>
      <van-tab name="0" title="全部"></van-tab>
    </template>
  </van-tabs>
    <!-- <mt-loadmore v-if="goload"
                 :top-method="loadTop"
                 :bottom-method="loadBottom"
                 :bottom-all-loaded="allLoaded"
                 ref="loadmore"
                 bottomPullText=''
                 bottomDropText='上拉加载...'
                 bottomLoadingText=''
                 :autoFill='true'
                 id='olis'> -->
    <div>
      <div v-show="orderType === 'storeBalance'">
        <div v-for="(model, i) in allBalance" :key="i" class="box">
          <div class="tbs">
            <ul class="item2">
              <li>订单号：{{ model.sn }}</li>
              <li>{{ model.created_at ? model.created_at : `&nbsp;` }}</li>
            </ul>
            <div class="item3">
              <span class="red">提成+{{ model.amount }}</span>
              <p :class="model.status_name == '未结算' ? 'no-red' : ''">{{ model.status_name }}</p>
            </div>
          </div>
        </div>
      </div>
    <!-- <mt-tab-container v-model="selected"> -->
      <div v-show="selected==3&&orderType!=='extension'">
      <!-- <mt-tab-container-item id="3"> -->
        <div v-for="(model, i) in all" :key="i">
          <!--<router-link v-for="model in all" :to="fun.getUrl('presentationDetails',{ record_id: model.id })">-->
          <div class="tbs">
            <ul class="item2">
              <li>订单号：{{ model.order_sn }}</li>
              <li>{{ model.created_at }}</li>
            </ul>
            <div class="item3">
              <span class="red">提成+{{ model.amount }}</span>
              <p :class="model.settlement == '未结算' ? 'no-red' : ''">{{ model.settlement }}</p>
            </div>
          </div>
          <!--</router-link>-->
        </div>
      <!-- </mt-tab-container-item> -->
      </div>
      <div v-if="selected==3&&orderType === 'extension'">
          <router-link
            v-for="(model, i) in reject"
            :key="i"
            :to="fun.getUrl('presentationDetails', { record_id: model.id })"
          >
            <div class="tbs">
              <ul class="item2">
                <li>{{ model.type_name }}</li>
                <li>{{ $i18n.t('money') }}{{ model.amounts }}</li>
              </ul>
              <div class="item3">
                <span class="red">{{ model.status_name }}</span>
                <p>{{ model.created_at }}</p>
              </div>
            </div>
          </router-link>
        </div>
      <div v-show="selected==''">
      <!-- <mt-tab-container-item id=""> -->
        <div v-if="orderType === 'supplier'">
          <!--供应商的提现记录-->
          <div v-for="(model, i) in all" :key="i">
            <div class="tbs">
              <ul class="item2">
                <li>{{ model.apply_sn }}</li>
                <li>{{ model.created_at }}</li>
              </ul>
              <div class="item3">
                <span class="red">{{ $i18n.t('money') }}{{ model.apply_money }}</span>
                <p v-if="orderType === 'supplier'" :class="model.status_obj.name == '未结算' ? 'no-red' : ''">{{ model.status_obj.name }}</p>
              </div>
            </div>
          </div>
        </div>
        <div v-if="orderType === 'extension'">
          <router-link
            v-for="(model, i) in all"
            :key="i"
            :to="fun.getUrl('presentationDetails', { record_id: model.id })"
          >
            <div class="tbs">
              <ul class="item2">
                <li>{{ model.type_name }}</li>
                <li>{{ $i18n.t('money') }}{{ model.amounts }}</li>
              </ul>
              <div class="item3">
                <span class="red">{{ model.status_name }}</span>
                <p>{{ model.created_at }}</p>
              </div>
            </div>
          </router-link>
        </div>

        <div v-if="orderType === 'store'">
          <div v-for="(model, i) in all" :key="i">
            <!--<router-link v-for="model in all" :to="fun.getUrl('presentationDetails',{ record_id: model.id })">-->
            <div class="tbs">
              <ul class="item2">
                <li>订单号：{{ model.order_sn }}</li>
                <li>{{ model.created_at }}</li>
              </ul>
              <div class="item3">
                <span class="red">提成+{{ model.amount }}</span>
                <p>{{ model.settlement }}</p>
              </div>
            </div>
          </div>
          <!--</router-link>-->
        </div>
      <!-- </mt-tab-container-item> -->
      </div>
      <div v-show="selected==='0'">
      <!-- <mt-tab-container-item id="0"> -->
        <div v-if="orderType === 'supplier'">
          <!--供应商的提现记录-->
          <div v-for="(model, i) in review" :key="i">
            <div class="tbs">
              <ul class="item2">
                <li>{{ model.apply_sn }}</li>
                <li>{{ model.created_at }}</li>
              </ul>
              <div class="item3">
                <span class="red">{{ $i18n.t('money') }}{{ model.apply_money }}</span>
                <p v-if="orderType === 'supplier'" :class="model.status_obj.name == '未结算' ? 'no-red' : ''">{{ model.status_obj.name }}</p>
              </div>
            </div>
          </div>
        </div>

        <div v-if="orderType === 'extension'">
          <router-link
            v-for="(model, i) in review"
            :key="i"
            :to="fun.getUrl('presentationDetails', { record_id: model.id })"
          >
            <div class="tbs">
              <ul class="item2">
                <li>{{ model.type_name }}</li>
                <li>{{ $i18n.t('money') }}{{ model.amounts }}</li>
              </ul>
              <div class="item3">
                <span class="red">{{ model.status_name }}</span>
                <p>{{ model.created_at }}</p>
              </div>
            </div>
          </router-link>
        </div>

        <div v-if="orderType === 'store'">
          <div v-for="(model, i) in review" :key="i">
            <!--<router-link v-for="model in review" :to="fun.getUrl('presentationDetails',{ record_id: model.id})">-->
            <div class="tbs">
              <ul class="item2">
                <li>订单号：{{ model.order_sn }}</li>
                <li>{{ model.created_at }}</li>
              </ul>
              <div class="item3">
                <span class="red">提成+{{ model.amount }}</span>
                <p>{{ model.settlement }}</p>
              </div>
            </div>
            <!--</router-link>-->
          </div>
        </div>
      <!-- </mt-tab-container-item> -->
      </div>
      <div v-show="selected==1">
      <!-- <mt-tab-container-item id="1"> -->
        <div v-if="orderType === 'supplier'">
          <!--供应商的提现记录-->
          <div v-for="(model, i) in waitPay" :key="i">
            <div class="tbs">
              <ul class="item2">
                <li>{{ model.apply_sn }}</li>
                <li>{{ model.created_at }}</li>
              </ul>
              <div class="item3">
                <span class="red">{{ $i18n.t('money') }}{{ model.apply_money }}</span>
                <p v-if="orderType === 'supplier'">{{ model.status_obj.name }}</p>
              </div>
            </div>
          </div>
        </div>

        <div v-if="orderType === 'extension'">
          <router-link
            v-for="(model, i) in waitPay"
            :key="i"
            :to="fun.getUrl('presentationDetails', { record_id: model.id })"
          >
            <div class="tbs">
              <ul class="item2">
                <li>{{ model.type_name }}</li>
                <li>{{ $i18n.t('money') }}{{ model.amounts }}</li>
              </ul>
              <div class="item3">
                <span class="red">{{ model.status_name }}</span>
                <p>{{ model.created_at }}</p>
              </div>
            </div>
          </router-link>
        </div>

        <div v-if="orderType === 'store'">
          <div v-for="(model, i) in waitPay" :key="i">
            <!--<router-link v-for="model in waitPay" :to="fun.getUrl('presentationDetails',{ record_id: model.id})">-->
            <div class="tbs">
              <ul class="item2">
                <li>订单号：{{ model.order_sn }}</li>
                <li>{{ model.created_at }}</li>
              </ul>
              <div class="item3">
                <span class="red">提成+{{ model.amount }}</span>
                <p>{{ model.settlement }}</p>
              </div>
            </div>
            <!--</router-link>-->
          </div>
        </div>
      <!-- </mt-tab-container-item> -->
      </div>
      <div v-show="selected==2">
      <!-- <mt-tab-container-item id="2"> -->
        <div v-if="orderType === 'supplier'">
          <!--供应商的提现记录-->
          <div v-for="(model, i) in pay" :key="i">
            <div class="tbs">
              <ul class="item2">
                <li>{{ model.apply_sn }}</li>
                <li>{{ model.created_at }}</li>
              </ul>
              <div class="item3">
                <span class="red">{{ $i18n.t('money') }}{{ model.apply_money }}</span>
                <p v-if="orderType === 'supplier'">{{ model.status_obj.name }}</p>
              </div>
            </div>
          </div>
        </div>

        <div v-if="orderType === 'extension'">
          <router-link
            v-for="(model, i) in pay"
            :key="i"
            :to="fun.getUrl('presentationDetails', { record_id: model.id })"
          >
            <div class="tbs">
              <ul class="item2">
                <li>{{ model.type_name }}</li>
                <li>{{ $i18n.t('money') }}{{ model.amounts }}</li>
              </ul>
              <div class="item3">
                <span class="red">{{ model.status_name }}</span>
                <p>{{ model.created_at }}</p>
              </div>
            </div>
          </router-link>
        </div>

        <div v-if="orderType === 'store'">
          <div v-for="(model, i) in pay" :key="i">
            <!--<router-link v-for="model in pay" :to="fun.getUrl('presentationDetails',{ record_id: model.id})">-->
            <div class="tbs">
              <ul class="item2">
                <li>订单号：{{ model.order_sn }}</li>
                <li>{{ model.created_at }}</li>
              </ul>
              <div class="item3">
                <span class="red">提成+{{ model.amount }}</span>
                <p>{{ model.settlement }}</p>
              </div>
            </div>
            <!--</router-link>-->
          </div>
        </div>
      <!-- </mt-tab-container-item> -->
      </div>
      <div v-show="selected==-1">
      <!-- <mt-tab-container-item id="-1"> -->
        <div v-if="orderType === 'supplier'">
          <!--供应商的提现记录-->
          <div v-for="(model, i) in invalid" :key="i">
            <div class="tbs">
              <ul class="item2">
                <li>{{ model.apply_sn }}</li>
                <li>{{ model.created_at }}</li>
              </ul>
              <div class="item3">
                <span class="red">{{ $i18n.t('money') }}{{ model.apply_money }}</span>
                <p v-if="orderType === 'supplier'">{{ model.status_obj.name }}</p>
              </div>
            </div>
          </div>
        </div>

        <div v-if="orderType === 'extension'">
          <router-link
            v-for="(model, i) in invalid"
            :key="i"
            :to="fun.getUrl('presentationDetails', { record_id: model.id })"
          >
            <div class="tbs">
              <ul class="item2">
                <li>{{ model.type_name }}</li>
                <li>{{ $i18n.t('money') }}{{ model.amounts }}</li>
              </ul>
              <div class="item3">
                <span class="red">{{ model.status_name }}</span>
                <p>{{ model.created_at }}</p>
              </div>
            </div>
          </router-link>
        </div>
    

        <div v-if="orderType === 'store'">
          <div v-for="(model, i) in invalid" :key="i">
            <!--<router-link v-for="model in invalid" :to="fun.getUrl('presentationDetails',{ record_id: model.id})">-->
            <div class="tbs">
              <ul class="item2">
                <li>订单号：{{ model.order_sn }}</li>
                <li>{{ model.created_at }}</li>
              </ul>
              <div class="item3">
                <span class="red">提成+{{ model.amount }}</span>
                <p>{{ model.settlement }}</p>
              </div>
            </div>
            <!--</router-link>-->
          </div>
        </div>
      <!-- </mt-tab-container-item> -->
      </div>
    <!-- </mt-tab-container> -->
    </div>
    <!-- </mt-loadmore> -->
  </div>
</template>
<script>
import member_income_presentationRecordcontroller from './member_income_presentationRecordcontroller';

export default member_income_presentationRecordcontroller;
</script>
<style lang="scss" rel="stylesheet/scss" scoped>

::v-deep .van-tabs__line{
  background-color: var(--themeBaseColor);
  width: 1.25rem;
  bottom: 21px;
}
#detailed {
  .today-box {
    background: white;
    margin:0.5rem 0.6rem 0 0.6rem;
    border-radius: 0.4rem;
    padding: 0.9rem 0.7rem 0.7rem 0.7rem;
    .month-sty {
      font-size: 0.9rem;
      font-weight: bold;
      color: #00001C;
      text-align: left;
      margin-bottom: 0.625rem;
    }
    .today_bonus {
      display: flex;
      justify-content: space-around;
      background: #FAFAFA;
      padding: 0.8rem 0;
      border-radius: 0.4rem;
      .box-money {
        font-size: 0.9rem;
        color: #00001C;
        font-weight: bold;
      }
      .box-data {
        font-size: 0.75rem;
        color: #6E6E79;
        margin-top: 0.25rem;
      }
    }
  }

  a {
    color: #000;
  }

  .mint-navbar {
    margin-bottom: 0.125rem;
  }

  .mint-navbar .mint-tab-item {
    padding: 0.875rem 0;
  }

  .times {
    text-align: left;
    text-indent: 0.625rem;
    line-height: 2rem;
    background: #fff;
  }

  .tbs {
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    margin: 0.4rem 0.75rem 0.625rem 0.75rem;
    border-radius: 0.5rem;
    // height: 67px;

    .item2 {
      flex: 3;
      text-align: left;
      height: 100%;

      li:last-child{
        font-size: 0.75rem;
        font-weight: 400;
        color: #6E6E79;
      }
      li:first-child{
        font-size: 0.8125rem;
        font-weight: bold;
        color: #00001C;
        margin-bottom: 0.3438rem;
        white-space: nowrap;
      }
    }

    .item3 {
      flex: 2;
      text-align: right;
      height: 100%;

      .red {
          color: #F15353;
          font-weight: 500;
          font-size: 0.85rem;
      }

      .no-red {
        color: #F15353;
      }

      .green {
        color: green;
      }

      .yellow {
        color: yellow;
      }

      .reduce {
        color: #e51c23;
      }

      span {
        display: inline-block;
        font-size: 0.9375rem;
        margin-bottom: 0.4688rem;
      }

      p {
        font-weight: 400;
        color: #6E6E79;
        font-size: 0.75rem;
      }
    }
  }
}
</style>
